package com.z6pin.coin.controller;


import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.z6pin.coin.domain.Person;
import com.z6pin.coin.entity.UserCoin;
import com.z6pin.coin.mapper.UserCoinMapper;

@RestController
public class CoinController {
    
	@Autowired
	UserCoinMapper userCoinMapper;
	
    @RequestMapping(value = "/saveCoin", method = RequestMethod.POST)
    public int save(@RequestBody UserCoin userCoin) {
    		int result = 0;
    		try {
    			result = userCoinMapper.insert(userCoin);
    		} catch(Exception e) {
    			System.out.println(e.getMessage());
    		}
    		return result;
    }
    
    @RequestMapping(value = "/canInsert", method = RequestMethod.POST)
    public String canInsert() {
    		
    		return "success";
    }
    
}
